<?php

namespace App\Http\Requests;


class CustomerProductRequest extends BaseRequest
{
    public function rules()
    {
        return [
//            'user_id' => 'required',
            'user_ids' => 'required',

            'discount' => 'required',
            'channel_group_id' => 'required',

            'items.*.user_price' => 'required',
            'items.*.product_id' => 'required',
            'items.*.spec_id' => 'required',
//            'items.*.user_id' => 'required',
            'items.*.channel_group_id' => 'required',

        ];
    }

    public function messages()
    {
        return [
            'user_ids.required' => '请选择用户',
            'discount.required' => '请输入折扣',
            'channel_group_id.required' => '请选择是否渠道组',

            'items.*.user_price.required' => '进价计算有误，请确认原价和折扣没有错',
            'items.*.product_id.required' => '参数有误:product_id',
            'items.*.spec_id.required' => '请选择产品',
//            'items.*.user_id.required' => 'user_id参数有误',
            'items.*.channel_group_id.required' => '请选择渠道组',
        ];
    }
}
